<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TPrideviceinfo extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_prideviceinfo', function (Blueprint $table) {
             $table->engine = 'MyISAM';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->increments('pdi_index')->nullable(false)->comment('');
			$table->string('pdi_name', 255)->nullable(false)->default('')->comment('');
			$table->string('pdi_code', 255)->nullable(false)->default('')->comment('');
			$table->integer('dpt_id')->nullable(false)->default(0)->comment('');
			$table->string('pdi_mac', 20)->nullable(false)->default('')->comment('');
			$table->string('pdi_ip', 16)->nullable(false)->default('')->comment('');
			$table->integer('pdi_port')->nullable(false)->default(0)->comment('');
			$table->integer('pdi_interval')->nullable(false)->default(20)->comment('');
			$table->string('pdi_pwd', 16)->nullable(false)->default('RICHCOMM')->comment('');
			$table->integer('pdi_saveinterval')->nullable(false)->default(30)->comment('');
			$table->datetime('pdi_updatetime')->nullable()->default(null)->comment('');
			$table->boolean('nm_delflag')->nullable(false)->default(0)->comment('');
			$table->boolean('pdi_enable')->nullable(false)->default(1)->comment('');
			$table->string('nm_memo', 255)->nullable()->default(null)->comment('');
			$table->string('AreaId', 20)->nullable()->default(null)->comment('');
			$table->string('u_username', 50)->nullable()->default(null)->comment('');
			$table->string('u_tel', 50)->nullable()->default(null)->comment('');
			$table->string('u_a', 2)->nullable()->default(null)->comment('');
			$table->string('u_b', 2)->nullable()->default(null)->comment('');
			$table->string('u_c', 2)->nullable()->default(null)->comment('');
			$table->string('u_d', 2)->nullable()->default(null)->comment('');
			$table->integer('u_myrootid')->nullable()->default(null)->comment('');
			$table->string('pdi_icon', 255)->nullable()->default(null)->comment('');
			$table->string('devicename', 255)->nullable()->default(null)->comment('鍙ｄ覆璁惧鐢ㄦ埛鍛藉悕');
			$table->string('childTypeName', 255)->nullable()->default(null)->comment('');
			$table->integer('bd_index')->nullable()->default(null)->comment('');
			$table->string('conn_tele_phone', 13)->nullable()->default(null)->comment('');
			$table->integer('snmp_typeid')->nullable(false)->default(0)->comment('');
			$table->string('snmp_version', 50)->nullable(false)->default('SNMPv1 ')->comment('');
			$table->string('snmp_community', 50)->nullable(false)->default('public')->comment('');
			$table->integer('Co_ID')->nullable()->default(0)->comment('');
			$table->string('Longitude', 100)->nullable()->default(0)->comment('');
			$table->string('Latitude', 100)->nullable()->default(0)->comment('');
			$table->string('DragX', 50)->nullable()->default(0)->comment('');
			$table->string('DragY', 50)->nullable()->default(0)->comment('');
			$table->integer('SubNum')->nullable()->default(0)->comment('');
			$table->unique('pdi_index', 'pdi_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_prideviceinfo');
    }
}
